<script>
    function loginButtonLoading(form, data, hasError) {
        if (!hasError) {
            var button = $('#login_submit');
            button.click(function () {
                button.button('loading')
            });
        }
        return true;
    }
</script>
<div class="jumbotron">
    <h1>ShineTech-TEST</h1>

    <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus
        commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>

    <div class="container">
        <?php $form = $this->beginWidget('CActiveForm', array(
            'id' => 'login_form',
            'enableAjaxValidation' => true,
            'enableClientValidation' => true,
            'errorMessageCssClass' => 'help-block',
            'clientOptions' => array(
                'validateOnSubmit' => true,
                'errorCssClass' => 'has-error',
                'afterValidate' => 'js:loginButtonLoading'
            ),
            'htmlOptions' => array('class' => 'row', 'role' => 'form'),
        )); ?>
        <div class="col-sm-5 col-sm-offset-2">
            <div class="form-group">
                <?php echo $form->textField($user_login,
                    'user_name',
                    array(
                        'class' => 'form-control',
                        'placeholder' => 'Username',
                    ));
                ?>
                <?php echo $form->error($user_login, 'user_name'); ?>
            </div>
            <div class="form-group">
                <?php echo $form->passwordField($user_login,
                    'user_password',
                    array(
                        'class' => 'form-control',
                        'placeholder' => 'Password',
                    ));
                ?>
                <?php echo $form->error($user_login, 'user_password'); ?>
            </div>
        </div>

        <div class="col-sm-3">
            <div class="form-group">
                <label for="LoginForm_user_remember" class="remember_me">
                    <?php echo $form->checkBox($user_login,
                        'user_remember',
                        array(
                            'value' => 1,
                        ));
                    ?> Remember me
                </label>
            </div>
            <?php echo $form->error($user_login, 'user_remember'); ?>
            <div class="form-group">
                <?php echo CHtml::submitButton('Login now', array('id' => 'login_submit', 'class' => 'btn btn-success', 'data-loading-text' => 'Login...')); ?>
            </div>
        </div>
        <?php $this->endWidget(); ?>
    </div>
</div>

<div class="row marketing">
    <div class="col-lg-6">
        <h4>Subheading</h4>

        <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>

        <h4>Subheading</h4>

        <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet
            fermentum.</p>

        <h4>Subheading</h4>

        <p>Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
    </div>

    <div class="col-lg-6">
        <h4>Subheading</h4>

        <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>

        <h4>Subheading</h4>

        <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet
            fermentum.</p>

        <h4>Subheading</h4>

        <p>Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
    </div>
</div>
